package com.bx.weixin.interceptor;

import com.demo.common.model.User;
import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

public class UserInterceptor implements Interceptor{
	
	private static final User  dao = new User().dao();

	@Override
	public void intercept(Invocation inv) {
		System.out.println("Before invoking " + inv.getActionKey());
		inv.invoke();
		System.out.println("After invoking " + inv.getActionKey());
		
		String sql = "select * from bx_user u where u.weixin_code='1' and u.state='1'";
		
		User u = dao.findFirst(sql);
		System.out.println(u);
	}

}
